package com.example.myapplication.my_view_model

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class MyViewModel: ViewModel() {
    var numLiveData: MutableLiveData<Int> = MutableLiveData()
    init {
        numLiveData.postValue(0)
    }
    fun setNumLiveData(v: Int){
        var a = numLiveData.value!!
        a += v
        numLiveData.postValue(a)
    }
    var num: Int = 0
}